﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImportPersonInfoByExcel.aspx.cs"
    Inherits="RN.ERP.Web.Person.ImportPersonInfoByExcel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript" src="../Scripts/jquery-pack.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div style="text-align: left;">
            <ul style="list-style: none;">
                <li>说明</li>
                <li>①点击【下载模板】，下载导入人员信息的模板，各模块对应的模板不同，请分别下载</li>
                <li>②按给定的格式填写信息，请勿修改模板中的可选项，否则会导入失败变成垃圾数据</li>
                <li>③模板中的证书类别已冻结，请无需输入</li>
                <li>④点击【浏览】将填写好的模板文件上传</li>
                <li>&nbsp;</li>
                <li><a id="downLoad" href="../Download/excel/empinfo.xls">下载模板</a></li>
                <li>&nbsp;</li>
                <li>
                    <asp:FileUpload ID="fileUpload" ClientIDMode="Static" runat="server" />
                    <asp:Button ID="btnUpload" ClientIDMode="Static" runat="server" Text="上传" Style="display: none;"
                        OnClick="btnUpload_Click" />
                </li>
                <li>&nbsp;</li>
                <li id="liEmp" runat="server" style="display: none;">未成功导入的人员如下：
                    <asp:Button ID="btnDaochu" runat="server" Text="导出Excel" OnClick="btnDaochu_Click" />
                    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                    </telerik:RadScriptManager>
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="ListCorps" LoadingPanelID="RadAjaxLoadingPanel1" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
                    <telerik:RadGrid ID="ListEmps" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                        Width="730px" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="false"
                        AllowPaging="false" AllowCustomPaging="false" AllowMultiRowSelection="true" OnNeedDataSource="ListEmps_NeedDataSource"
                        AllowSorting="false" ShowStatusBar="true">
                        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                            <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                AllowColumnResize="True"></Resizing>
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="false" >
                            <CommandItemSettings ExportToPdfText="导出PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                            </RowIndicatorColumn>
                            <Columns>                             
                                <telerik:GridBoundColumn DataField="ZSTypeName" HeaderText="证书类别" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Name" HeaderText="姓名" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="IDCard" HeaderText="身份证号码" HeaderStyle-Width="80px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSName" HeaderText="证书名称" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSCode" HeaderText="证书编号" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSspecialty" HeaderText="岗位" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSLevel" HeaderText="等级" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSGetTime" HeaderText="获取时间" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ZSEndTime" HeaderText="有效期到" HeaderStyle-Width="50px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Description" HeaderText="错误描述" HeaderStyle-Width="300px">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" EnableShadow="true">
                    </telerik:RadWindowManager>
                </li>
            </ul>
        </div>
    </div>
    <input id="hdGroupID" type="hidden" runat="server" value="" control="GroupID" />
    </form>
    <script type="text/javascript">
        var fileExtensions = /(.xls|.xlsx)$/i;

        $("#fileUpload").change(function () {
            var fileName = this.value;
            $("#btnUpload").click();
        });

        //alert($("#hdGroupID").val());
        if ($("#hdGroupID").val() == "1404")
            $("#downLoad").attr("href", "../Download/excel/安全生产三类人员.xls");
        else if ($("#hdGroupID").val() == "1401")
            $("#downLoad").attr("href", "../Download/excel/特种作业人员.xls");
        else if ($("#hdGroupID").val() == "1402")
            $("#downLoad").attr("href", "../Download/excel/关键岗位人员.xls");
        else if ($("#hdGroupID").val() == "1403")
            $("#downLoad").attr("href", "../Download/excel/职业技能人员.xls");
        else if ($("#hdGroupID").val() == "1406")
            $("#downLoad").attr("href", "../Download/excel/注册建造师.xls");
        else if ($("#hdGroupID").val() == "1407")
            $("#downLoad").attr("href", "../Download/excel/建筑业技师.xls");
//        else if ($("#hdGroupID").val() == "0") {
//            $("#downLoad").attr("href", "../Download/excel/职称人员.xls");
//        }
            

    </script>
</body>
</html>
